home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd25.zip
/
DOC.ZIP
/
PACKAGE.DOC
< prev
next >
Wrap
Text File
|
1992-11-09
|
37KB
|
861 lines
========================================================================
== ME2 Packages Craig Durland 10/91 ==
========================================================================
Here is some documentation on some of the packages of Mutt programs I
use.
Copyright 1991 Craig Durland
Distributed under the terms of the GNU General Public License.
Distributed "as is", without warranties of any kind, but comments,
suggestions and bug reports are welcome.
========================================================================
== Customizing me2.mut ==
========================================================================
Overview:
When ME2 runs, it tries to load several files:
osstuff.mco : OS related stuff.
./mext.mco : Directory local ME2 extensions
myme.mco : Your personal ME2 extensions.
(You can change this behavior, see package me2.mut below).
Package: me2.mut
How loaded: Compiled into ME2 (with the C compiler).
Description:
This is (most of) the front end for ME2. It sets up lots of
keybindings, autoloading, etc. When ME2 runs, me2.mut tries to load
several files:
osstuff.mco : OS related stuff.
./mext.mco : Directory local ME2 extensions
myme.mco : Your personal ME2 extensions.
If you want to change basic ME2, edit this file, and recompile ME2.
Package: myme.mut
How loaded: By me2.mut as part of start up.
Description:
This is the file that you put your personal extensions to ME2 in.
This is the stuff you don't want to everybody to have to use. You
should put myme.mco in a spot that that is only in your ME2 path
(such as your home directory).
A copy of the file I use is in ../mutt/myme.mut.
Functions you might to call:
command-line-done (bool it-has-been-processed)
Call this if you have processed the command line.
Package: osstuff.mco
See: OS Stuff below.
Package: ./mext.mut
How loaded: By me2.mut as part of start up.
Description:
If this file is the current directory when ME2 starts, me2.mut will
load it. Use it to hold stuff you want ME2 to know about only in
this directory.
For example, I have a bunch of Mutt code to help me design bicycles.
I could autoload it but then I would have to type something
every time I wanted to work on a bicycle. Since I do all the work in
the bicycle directory, I just put the code in bicycle/myme.mco and
when I run ME2, it is loaded automatically.
========================================================================
== Mark Rings ==
========================================================================
Package: markring.mut
How loaded: part of me2.mut, turned on for interactive buffers
Description:
Mark rings provide a way to mark multiple places in a buffer so you
can jump to them easily. Note that they can't span buffers. Up to 4
marks (easily changeable in markring.mut) are kept, as more are set,
the ring wraps around and reuses the older marks.
Functions:
markring-push M-C-p or F-9
Push the dot into the end of the ring.
markring-pop M-p
Goto the next mark in the ring.
markring-delete Not bound
Remove the most recently popped mark from the ring.
markring-init Not bound
Use this if a markring was not setup in this buffer (it normally is)
or you want to remove all marks from the ring and start over.
========================================================================
== Mode Support ==
========================================================================
Package: alamode.mut
How loaded: part of me2.mut
Description:
This is the package that turns on modes. Here is how it works (in the
order that things happen):
- When a interactive buffer is created, if the environment variable
MEMODE is set, "-mode" is appended to it and a call is made to that
function. For example, if MEMODE is set to "mail", every time a
interactive buffer is created, "mail-mode" is called for that
buffer. If the mode doesn't exist, ME2 will complain.
- If there is no MEMODE variable, the buffer name is looked at. The
list of modes is looked at to see if any of the modes fits the name.
(You can change the list with auto-mode-list (see below).) Here are
the default modes:
Extension Program Run
--------- ------- ---
.c c-mode
.h c-mode
.mut mutt-mode
.doc text-mode
.txt text-mode
If the program is not there, ME2 will complain, but you might not
see it because other things will be written to the command line
after the error message (like "[Read 10 lines]"). No harm is done
if the mode is not run.
If there are no matches, the default-major-mode is run (see below).
- When a file is read into a interactive buffer, the first line of the
buffer is looked at. If it contains text of the form "-*-foo-*-",
foo-mode is run.
Functions:
default-major-mode Not bound
Set the default major mode. This is the mode set for a interactive
buffer when no other mode seems to fit.
For example: If you want text mode to be the default:
(default-major-mode "text"). The "-mode" is appended when the mode
needs to be run.
The mode might be changed when the file is read in (see above).
The default is "none".
(auto-mode-list (bool append)(string mode-re mode-name ...)
Append or Prepend to the list of modes.
Input:
append: TRUE if you want your list of modes to be appended (ie
searched last) to the list of modes. There are two reasons you
might want to do this: If you have not-very-often used mode,
putting it a the end of the list means a quicker search time for
the more often used modes. If you want to override one of the
defaults, prepend so your new mode will be found first.
mode-re:
This is a regular expression that the buffer name is tested with.
If there is a match, mode-name is run. For example, if you
want to test for the extension foo, use '.*\.foo$'. The
single quote is important. This re matches any string that
ends with the characters ".foo". Note: the re is not a
searching re - it is in place regular expression match. That
is why you need the .* at the start.
Notes:
The mode-re is used to match the buffer name NOT the file
name. Since I do the match at buffer create time, I don't
have a file name. If you want to match file names, you will
need to change the call to set-mode from buffer-created-hook
to file-read-hook. I used buffer-created-hook because then
I can use (switch-to-buffer) and have the mode set without
reading in a file.
My Unix mailer uses temp files named "/tmp/Re<digits>". An re
to match that is 'Re[0-9]+$'. Then, whenever mail uses ME
to edit mail, you can edit with your favorite mail mode.
mode-name: The name of the mode you want to run if there is a
match. If you want c mode, use "c". The "-mode" is appended
when the mode needs to be run.
Here is the default:
(auto-mode-list TRUE
'.*\.c$' "c"
'.*\.h$' "c"
'.*\.mut$' "mutt"
'.*\.doc$' "text"
'.*\.txt$' "text"
)
If you want to get rid of mode, prepend it and use none. For
example, if you don't like c mode, use
(auto-mode-list FALSE '.*\.c$' "none" '.*\.h$' "none") and c-mode
won't be called. Of course, you could also just remove cmode.mco
and achieve the same result.
If you want to get rid of all modes, use
(auto-mode-list FALSE '.' "none"). This will set every buffer to
none-mode.
Notes:
While using the mode-re's gives a lot of flexibility, I wonder about
the speed hit. Knowing how all this is implemented, it seems like
all those regular expression tests has got to take a long time. It
doesn't seem to on my machine (but its a real fast machine). Does
anyone use anything but the extension? If not, i